﻿<html xmlns="http://www.w3.org/1999/xhtml">
<head >
    <title>驰骋工作流引擎登录</title>
    <meta charset="UTF-8"/>
    <link href="../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/bootstrap/js/jquery.min.js"></script>
    <script src="../Scripts/easyUI/jquery-1.8.0.min.js" type="text/javascript"></script>
    <script src="../Scripts/QueryString.js" type="text/javascript"></script>
    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="../Scripts/config.js"></script>
    <script type="text/javascript" src="../Comm/Gener.js"></script>
    <script type="text/javascript" language="javascript" >
        //页面启动函数.
        $(function () {

            $("#Msg").html("<img src='../Img/loading.gif' /><font color=blue>ccbpm 正在为登做准备.</font>");

            var handler = new HttpHandler("BP.WF.HttpHandler.WF_AppClassic");
            var data= handler.DoMethodReturnString("Login_Init");

            if (data.indexOf('err@') == 0) {
                alert(data);
                return;
            }

            data = JSON.parse(data);

            //调用公共类库的方法:执行批量主表赋值
            GenerFullAllCtrlsVal(data);

            var userNo = document.getElementById("TB_UserNo").value;
            if (userNo == "")
                document.getElementById("TB_Pass").value = "";

            $("#Msg").html("<font color=blue>ccbpm 欢迎登录...</font>");
            return;
        });

        function Login_Submit() {

            var userNo = document.getElementById("TB_UserNo").value;
            var userPass = document.getElementById("TB_Pass").value;

            if (userNo == "" || userPass == "") {
                alert('请输入用户名与密码');
                return;
            }

            $("#Msg").html("<img src='../Img/loading.gif' /><font color=blue>ccbpm 正在登录请稍候....</font>");

            var handler = new HttpHandler("BP.WF.HttpHandler.WF_AppClassic");
            
            handler.AddPara("TB_UserNo", encodeURIComponent(userNo));
            handler.AddPara("TB_Pass", userPass);

            var data = handler.DoMethodReturnString("Login_Submit");

            if (data.indexOf('err@') == 0) {
                $("#Msg").html("<font color=red>" + data + "</font>");
                return;
            }
            window.location.href = 'Home.htm';
        }

        function KeyDownUserNo(event) {

            if (event.keyCode == 13) {
                var ctrl = document.getElementById("TB_Pass");
                ctrl.focus();
            }
        }
        function KeyDownUserPass(event) {
            if (event.keyCode == 13) {
                var ctrl = document.getElementById("btn_login");
                ctrl.focus();
            }
        }
    </script>
    <style type="text/css">
    table
    {
        border:0px;
         margin-left:30px;
    }
    td
    {
        border:0px;
    }
    </style>
</head>
<body>
    <form id="cc" >

    <br />
    <br />
    <br />
   <center>
   <fieldset style="width:30%;text-align:left; float:center">
    <legend> <img src="../../DataUser/ICON/LogBiger.png" border=0 width="200px;" />  </legend>

    <br />

    <table>
    <tr  >
    <td  >用户名</td>
    <td ><input type="text" id="TB_UserNo" name="TB_UserNo"   onkeydown="KeyDownUserNo(event)"  style="width:80%;" /> </td>
    </tr>
    <tr >
    <td > 密&nbsp;&nbsp;码</td>
    <td><input type="password" id="TB_Pass" name="TB_Pass" value="123" onkeydown="KeyDownUserPass(event)"   style="width:80%;" /> </td>
    </tr>

    <tr>
    <td  ></td>
    <td colspan=1 style="border:0px;border-color:White;width:80%;" > <input type="button" value="操作员登录" id="btn_login" onclick="Login_Submit()" />
    <font color="gray" >默认密码为:123</font></td>
</tr>
    </table>
     <ul>
     <li>登录界面是有您来编写的。 </li>
     <li>密码的验证，登录前后要处理的业务逻辑均有您来开发。 </li>
     <li>验证成功后，就调用ccflow的登录API。 </li>
     <li>点击这里<a href="../Admin/CCBPMDesigner/Login.htm" >登录流程设计器</a>。</li>
    </ul>

    <div id="Msg" />
    </fieldset>
     
     </center>

    </form>


</body>
</html>
